物理キーボード用拡張shortcut keyを導入するScrapBindingsの設定
scrapboxにおける物理キーボードの挙動を調べたところ、PCで存在するいくつかのshortcut keyがScrapbox@Chrome for Androidにはなかった
それらのshortcut keyに該当する操作をScrapBindings経由で導入するためのscript
一部のキーはMOBO Keyboardから送信できなかったので、代替のキーを使っている
MOBO Keyboardで送信できないKeyboardEventの一覧
2022-08-19
21:50:09 コピペ機能を削った
2022-08-13
16:14:58 公式で修正されたみたい
@shokai: 様々な苦難を乗り越えてiPad+物理キーボードでのコピペがリリースされた
/villagepump/2022/08/12#62f65216b8db540000fe2564
ここの設定を一旦全部外して、挙動を確認しよう
2022-08-14 06:53:32 だいたいわかってきた
パッチ不要
コピー、切り取り、貼り付け
パッチ必要
アウトライン編集
2022-05-16
06:39:07 mobile版scrapboxのtext-inputにfocusを当てる処理をCursorを使った方法に変えた
長押しを待つ必要がない
直前にカーソルがあった場所に出せる
2022-02-10
13:17:25 scrapbox-userscript-stdに差し替えた
2022-01-07
10:54:22 takker99/takker-schedulerに差し替えた
コピーと切り取りも実装した
2022-01-06
03:14:36 caret()でコピペ周りを再実装したい
2021-08-23
12:58:42 mobile版scrapboxのtext-inputにfocusを当てられるようにした
2021-08-12
15:47:09 テスト終了
<C-x>の再現はちょっと無理だった
他は全部できた
dependencies
scrapbox-userscript-std
code:script.js
import {
indentLines, outdentLines, upLines, downLines,
indentBlocks, outdentBlocks, upBlocks, downBlocks,
insertText, caret, takeCursor,
} from "../scrapbox-userscript-std/dom.ts";
export const mobile = !/mobile/i.test(navigator.userAgent) ? [] : [
// アウトライン編集
{key: 'ctrl+h', command: () => {outdentLines();return false;},},
{key: 'ctrl+j', command: () => {downLines();return false;},},
{key: 'ctrl+k', command: () => {upLines();return false;},},
{key: 'ctrl+l', command: () => {indentLines();return false;},},
{key: 'alt+h', command: () => {outdentBlocks();return false;},},
{key: 'alt+j', command: () => {downBlocks();return false;},},
{key: 'alt+k', command: () => {upBlocks();return false;},},
{key: 'alt+l', command: () => {indentBlocks();return false;},},
/*
// コピーペースト
{key: 'ctrl+c', command: async () => {
try {
const text = caret().selectedText;
if (text === "") return false;
await navigator.clipboard.writeText(text);
return false;
} catch(e) {
console.error(e);
alert(Failed to copy: ${e.message});
};
},},
{key: 'ctrl+x', command: async () => {
try {
const text = caret().selectedText;
if (text === "") return false;
await navigator.clipboard.writeText(text);
return true;
} catch(e) {
console.error(e);
alert(Failed to copy: ${e.message});
};
},},
{key: 'ctrl+v', command: async () => {
try {
const text = await navigator.clipboard.readText();
await insertText(text);
return false;
} catch(e) {
console.error(e);
alert(Failed to paste: ${e.message});
};
},},
*/
// 文字入力できる状態にする
{key: 'i', command: () => {
const cursor = takeCursor();
cursor.focus();
cursor.showEditPopupMenu();
return false;
}, type: 'browser',},
];
#2022-08-19 21:50:02
#2022-08-14 06:55:42
#2022-08-13 16:15:54
#2022-05-16 06:38:58
#2022-02-10 13:17:22
#2022-01-06 03:15:32
#2021-08-23 11:08:37
#2021-08-12 15:37:19